# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Tom Gundersen <teg@jklm.no>
# Contributor: Ike Devolder <ike.devolder@gmail.com>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: Tobias Powalowski <tpowa@archlinux.org>

pkgname=taglib
pkgver=1.13
pkgrel=1
pkgdesc='A Library for reading and editing the meta-data of several popular audio formats'
arch=(x86_64)
url='https://taglib.github.io/'
license=(LGPL MPL)
depends=(zlib)
makedepends=(cmake)
checkdepends=(cppunit)
source=(https://taglib.github.io/releases/$pkgname-$pkgver.tar.gz)
sha256sums=('58f08b4db3dc31ed152c04896ee9172d22052bc7ef12888028c01d8b1d60ade0')

build() {
  cmake -B build -S $pkgname-$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_SHARED_LIBS=ON \
    -DCMAKE_CXX_FLAGS="$CXXFLAGS -DNDEBUG"
  cmake --build build
}

check() {
  cmake --build build --target test
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
